package cn.gson.springmvc.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Drugapply {
    private int drugapplyId;
    private String drugapplyName;
    private String drugapplyGuige;
    private Long drugapplyShuliang;
    private Long drugapplyDanjia;
    private Long drugapplyType;
    private Long drugapplyMoney;
    private String drugapplyPeople;
    private Long drugapplyState;
    private Drug drugByDrugId;

    @Id
    @Column(name = "drugapply_id", nullable = false)
    public int getDrugapplyId() {
        return drugapplyId;
    }

    public void setDrugapplyId(int drugapplyId) {
        this.drugapplyId = drugapplyId;
    }

    @Basic
    @Column(name = "drugapply_name", nullable = true, length = 30)
    public String getDrugapplyName() {
        return drugapplyName;
    }

    public void setDrugapplyName(String drugapplyName) {
        this.drugapplyName = drugapplyName;
    }

    @Basic
    @Column(name = "drugapply_guige", nullable = true, length = 30)
    public String getDrugapplyGuige() {
        return drugapplyGuige;
    }

    public void setDrugapplyGuige(String drugapplyGuige) {
        this.drugapplyGuige = drugapplyGuige;
    }

    @Basic
    @Column(name = "drugapply_shuliang", nullable = true, precision = 0)
    public Long getDrugapplyShuliang() {
        return drugapplyShuliang;
    }

    public void setDrugapplyShuliang(Long drugapplyShuliang) {
        this.drugapplyShuliang = drugapplyShuliang;
    }

    @Basic
    @Column(name = "drugapply_danjia", nullable = true, precision = 0)
    public Long getDrugapplyDanjia() {
        return drugapplyDanjia;
    }

    public void setDrugapplyDanjia(Long drugapplyDanjia) {
        this.drugapplyDanjia = drugapplyDanjia;
    }

    @Basic
    @Column(name = "drugapply_type", nullable = true, precision = 0)
    public Long getDrugapplyType() {
        return drugapplyType;
    }

    public void setDrugapplyType(Long drugapplyType) {
        this.drugapplyType = drugapplyType;
    }

    @Basic
    @Column(name = "drugapply_money", nullable = true, precision = 0)
    public Long getDrugapplyMoney() {
        return drugapplyMoney;
    }

    public void setDrugapplyMoney(Long drugapplyMoney) {
        this.drugapplyMoney = drugapplyMoney;
    }

    @Basic
    @Column(name = "drugapply_people", nullable = true, length = 30)
    public String getDrugapplyPeople() {
        return drugapplyPeople;
    }

    public void setDrugapplyPeople(String drugapplyPeople) {
        this.drugapplyPeople = drugapplyPeople;
    }

    @Basic
    @Column(name = "drugapply_state", nullable = true, precision = 0)
    public Long getDrugapplyState() {
        return drugapplyState;
    }

    public void setDrugapplyState(Long drugapplyState) {
        this.drugapplyState = drugapplyState;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Drugapply drugapply = (Drugapply) o;
        return drugapplyId == drugapply.drugapplyId &&
                Objects.equals(drugapplyName, drugapply.drugapplyName) &&
                Objects.equals(drugapplyGuige, drugapply.drugapplyGuige) &&
                Objects.equals(drugapplyShuliang, drugapply.drugapplyShuliang) &&
                Objects.equals(drugapplyDanjia, drugapply.drugapplyDanjia) &&
                Objects.equals(drugapplyType, drugapply.drugapplyType) &&
                Objects.equals(drugapplyMoney, drugapply.drugapplyMoney) &&
                Objects.equals(drugapplyPeople, drugapply.drugapplyPeople) &&
                Objects.equals(drugapplyState, drugapply.drugapplyState);
    }

    @Override
    public int hashCode() {
        return Objects.hash(drugapplyId, drugapplyName, drugapplyGuige, drugapplyShuliang, drugapplyDanjia, drugapplyType, drugapplyMoney, drugapplyPeople, drugapplyState);
    }

    @ManyToOne
    @JoinColumn(name = "drug_id", referencedColumnName = "drug_id")
    public Drug getDrugByDrugId() {
        return drugByDrugId;
    }

    public void setDrugByDrugId(Drug drugByDrugId) {
        this.drugByDrugId = drugByDrugId;
    }
}
